package com.netease.nieweb.emarket.lottery;


import com.netease.nieweb.emarket.api.UmsService;
import com.netease.nieweb.emarket.lottery.service.AbstractLotteryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 使用说明： 使用了 yaml配置中心后我的请求一直访问不到资源是404  出现这个情况的话 在Controller类在加一个@RequestMapping("/alibaba")
 *
 * @author huangxiangxiang
 * @version 2.0.0
 * @createTime 2019年09月10日 13:25:00
 */

@RestController
@RequestMapping("/lottery")
@RefreshScope
public class LotteryController {

   //@DubboReference
    UmsService umsService;

    @Autowired
    AbstractLotteryService defaultLotteryService;

    @RequestMapping("/test")
    public Object getNmaeList() {
        return  umsService.getUser();
    }

    @RequestMapping("")
    public Object lottery(String actId) {
        return  defaultLotteryService.lottery(actId);
    }
}